package com.ruoyi.common.core.mybatis;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;

import java.util.List;

/**
 * @author : hcl
 * @Date : 2023/9/8 10:51
 */
public class Update<T> extends UpdateWrapper<T> {

    private static final long serialVersionUID = 5686935544974401064L;

    @Override
    public Update<T> set(String column, Object val) {
        super.set(column, val);
        return this;
    }

    public Update<T> setName(String name) {
        super.set("name", name);
        return this;
    }

    public Update<T> setUserId(String userId) {
        super.set("user_id", userId);
        return this;
    }

    public Update<T> setDelete(boolean delete) {
        super.set("is_delete", delete);
        return this;
    }

    public Update<T> teamId(Long teamId) {
        super.eq("team_id", teamId);
        return this;
    }

    public Update<T> wxId(String wxId) {
        super.eq("wx_id", wxId);
        return this;
    }

    public Update<T> userId(String userId) {
        super.eq("user_id", userId);
        return this;
    }

    public Update<T> userId(List<String> userIds) {
        super.in("user_id", userIds);
        return this;
    }

    public Update<T> id(Long id) {
        super.eq("id", id);
        return this;
    }

    @Override
    public Update<T> eq(String column, Object val) {
        super.eq(column, val);
        return this;
    }
}
